# README for GRAPHS Directory

This repository contains Stata programs (`.do` files) specifically used to generate the descriptive figures for the study. These scripts focus on visualizing the relationship between national earnings percentiles, geographic mobility (in-state vs. out-of-state), and self-employment trends over time.

## Visualization Scripts

* **`01.01.percentile_byyear.do`**
    * **Purpose:** Generates **Figure 2A** in the paper.
    * **Details:** Uses a lowess smoothing method to plot the "Share Employed In-State" against the "National Earnings Percentile." It compares these trends at 1, 5, and 10 years post-graduation to show how higher earners are more likely to migrate out-of-state over time.
* **`01.06.percentile_assoc_byyear.do`**
    * **Purpose:** Generates **Figure 2B** in the paper.
    * **Details:** Performs the same analysis as Figure 2A but specifically for graduates with **Associate Degrees**. This allows for a comparison of mobility patterns between different degree levels.
* **`04.01.selfemp_graphs.do`**
    * **Purpose:** Generates **Figure 1** in the paper.
    * **Details:** Visualizes employment composition over the years following graduation. It plots four distinct categories:
        1.  **Only Self-Employed:** Individuals with self-employment earnings but no UI-covered earnings.
        2.  **Self-Employed:** Total share with any self-employment income.
        3.  **Only UI:** Individuals in the UI system with no self-employment.
        4.  **Only In-State UI:** Individuals only appearing in the local state's UI records.
    * **Additional Analysis:** Also calculates and graphs the share of total earnings accounted for by self-employment.

## Data & Output

* **Input Data:** These scripts primarily draw from `percentile_byyear.dta`, `percentile_assoc_byyear.dta`, and `all_earnings_long.dta`.
* **Results:** Graphs are exported as `.png` files to the directory defined by the `$resultsdir` global macro.
* **Support Files:** The scripts generate `.csv` or `.dta` support files (e.g., `support_share_selfemp_$date.csv`) containing the summarized data used for the plots.

## Setup

These programs require the `config.do` file to be present in the working directory to initialize the following macros:
- `$datadir`: Path to the source datasets.
- `$resultsdir`: Path where the generated figures will be saved.
- `$logdir`: Path for the execution logs.
- `$date`: Current date string used for versioning output files.